#!/bin/bash
# ~/Desktop/workspaces/python-tool/shell/say_n6.sh 0

wakeupword="小狐狸"
#online_query_array=("衡阳的衡山和山西的恒山哪个好")
online_query_array=("帮我查一下深圳明天的天气怎么样" "深圳的天气" "导航去深圳市南山区软件产业基地4栋A座" "附近的快捷酒店" "我要听林俊杰的歌" "播放张杰的天下"
  "打开系统设置" "帮我关闭副驾车窗" "空调温度调到25度")
offline_query_array=("增大音量" "打开腾讯视频" "调亮屏幕" "打开车窗" "关闭主驾车窗" "空调温度调到20度" "风量调到中等" "打开空调"
  "关闭空调")

array=None

if [[ $1 -eq 9 ]]; then
  while true; do
    echo $wakeupword
    say $wakeupword
    sleep 1
  done
else
  if [[ $1 -eq 0 ]]; then
    for ((i = 0; i < ${#online_query_array[@]}; i++)); do
      array[i]=${online_query_array[i]}
    done
  else
    for ((i = 0; i < ${#offline_query_array[@]}; i++)); do
      array[$i]=${offline_query_array[i]}
    done
  fi
  while true; do
    for ((i = 0; i < ${#array[@]}; i++)); do
      echo $wakeupword
      say $wakeupword
      sleep 2
      echo ${array[i]}
      say ${array[i]}
      sleep 5
    done
  done
fi
